import logging

import requests


class WeatherForecast:

    def weather_forecast(self, url, data):
        headers = {'content-type': 'application/x-www-form-urlencoded'}
        result = requests.post(url=url,data=data,headers=headers)
        return result



if __name__ == '__main__':
    url = "http://apis.juhe.cn/simpleWeather/query"
    data = {'city': '深圳', 'key': 'f19ce33c1de05b6e6b9a37d3c1dba0bf'}
    result = WeatherForecast().weather_forecast(url,data)
    print(result.json())